const Router = require('koa-router')
const deletecontent = new Router()
//！拿到前端的数据
//数据库连接池
const pg = require('pg');
let psql = new pg.Pool({
    database: 'running',
    user: 'run',
    port: 5432,
    host: '82.157.94.115',
    password: 'z12345678',
    max: 2
})

deletecontent.post('/deletecontent', async ctx => {
    let { content_id } = ctx.request.body
    let deleteContentPostgresql = `delete from content where content_id = '${content_id}'`;
    let content = await psql.query(deleteContentPostgresql);

    ctx.body = {
        msg: '删除成功'
    };

})

module.exports = deletecontent;